package com.zzty.train.pjm.dao;


import com.zzty.train.pjm.entity.Group;
import com.zzty.train.pjm.entity.Question;
import com.zzty.train.pjm.entity.TeamExam;
import com.zzty.train.pjm.util.PageUtils;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeanExamMapper {
    @Select("select * from question")
    public List<Question>getQuestion();

    @Select("select count(*) from question")
    public Integer getQuestionCount();

    @Select("select * from question limit #{pageNo} , #{pageSize}")
    public List<Question>getPageQuestion(PageUtils pageUtils);

    @Insert("insert into question (content) values (#{content})")
    public Integer addQuestion(Question question);

    @Insert("insert into teamExam (questionId,date,clazzId)values (#{questionId},#{date},#{clazzId})")
    public Integer submitQuestion(TeamExam teamExam);

    @Insert("insert into groupp (userName1,userName2,clazzId) values (#{userName1} , #{userName2},#{clazzId})")
    public Integer addTeam(Group group);

    @Select("select * from groupp where clazzId=#{clazzId}")
    public List<Group>group(Group group);

    @Delete("delete  from groupp where id=#{id}")
    public Integer deleteGroup(Group group);
}
